package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Municipalities generated by hbm2java
 */
@Entity
@Table(name="municipalities"
    ,catalog="madr_bd10"
    , uniqueConstraints = @UniqueConstraint(columnNames="code_mun") 
)
public class Municipalities  implements java.io.Serializable {


     private Integer idMun;
     private Departments departments;
     private String codeMun;
     private String nameMun;
     private Set farmses = new HashSet(0);
     private Set communeses = new HashSet(0);
     private Set distirctses = new HashSet(0);
     private Set entitieses = new HashSet(0);

    public Municipalities() {
    }

	
    public Municipalities(Departments departments, String codeMun, String nameMun) {
        this.departments = departments;
        this.codeMun = codeMun;
        this.nameMun = nameMun;
    }
    public Municipalities(Departments departments, String codeMun, String nameMun, Set farmses, Set communeses, Set distirctses, Set entitieses) {
       this.departments = departments;
       this.codeMun = codeMun;
       this.nameMun = nameMun;
       this.farmses = farmses;
       this.communeses = communeses;
       this.distirctses = distirctses;
       this.entitieses = entitieses;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_mun", unique=true, nullable=false)
    public Integer getIdMun() {
        return this.idMun;
    }
    
    public void setIdMun(Integer idMun) {
        this.idMun = idMun;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_departament_mun", nullable=false)
    public Departments getDepartments() {
        return this.departments;
    }
    
    public void setDepartments(Departments departments) {
        this.departments = departments;
    }
    
    @Column(name="code_mun", unique=true, nullable=false, length=10)
    public String getCodeMun() {
        return this.codeMun;
    }
    
    public void setCodeMun(String codeMun) {
        this.codeMun = codeMun;
    }
    
    @Column(name="name_mun", nullable=false, length=100)
    public String getNameMun() {
        return this.nameMun;
    }
    
    public void setNameMun(String nameMun) {
        this.nameMun = nameMun;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="municipalities")
    public Set getFarmses() {
        return this.farmses;
    }
    
    public void setFarmses(Set farmses) {
        this.farmses = farmses;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="municipalities")
    public Set getCommuneses() {
        return this.communeses;
    }
    
    public void setCommuneses(Set communeses) {
        this.communeses = communeses;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="municipalities")
    public Set getDistirctses() {
        return this.distirctses;
    }
    
    public void setDistirctses(Set distirctses) {
        this.distirctses = distirctses;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="municipalities")
    public Set getEntitieses() {
        return this.entitieses;
    }
    
    public void setEntitieses(Set entitieses) {
        this.entitieses = entitieses;
    }




}


